function gen_func1(arg) {
    var str = [];
    str.push(arg + '!');
    return str;
}
var resultsd = gen_func1('Hello world');
console.log(resultsd);
var Qyeye = /** @class */ (function () {
    function Qyeye() {
        var _this = this;
        this.data = [];
        this.push = function (item) { return _this.data.push(item); };
        this.pop = function () { return _this.data.shift(); };
    }
    return Qyeye;
}());
var queue = new Qyeye();
queue.push(0);
//二种
var gen_func2 = function (arg) {
    return arg;
};
gen_func2('Hello world');
// 第二种调用方式可省略类型参数，因为编译器会根据传入参数来自动识别对应的类型。
function any_func(arg) {
    console.log(arg.length);
    return arg;
}
function reverse(items) {
    var toreturn = [];
    for (var i = items.length - 1; i >= 0; i--) {
        toreturn.push(items[i]);
    }
    return toreturn;
}
var sample = [1, 2, 3];
var reversed = reverse(sample);
// let reversed = reverse<number>(sample);
// console.log(reversed)
// reversed[0] = '1'; // Error
// reversed = ['1', '2']; // Error
reversed[0] = 1; // ok
reversed = [1, 2]; // ok
//传入的数组里面是number 类型  所以输出赋值也要是number
